<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script type="text/javascript" src="../js/vue.js"></script>
    <script type="text/javascript" src="../js/axios.min.js"></script>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script type="text/javascript" src="../js/bootstrap.min.js"></script>
    <link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="../css/animate.css">
</head>

<body>
    <div id="app" class="container">
        <button class="btn btn-default" @click="flag = !flag">toggle</button>
        <!-- animate.css中的入场使用bounceIn，离场使用bounceOut，在低版本时，需要添加基本类animated后才能正常使用animate.css -->
        <!-- :duration 来统一设置入场和离场的动画时长【:duration="200"】，也可以通过传入一个对象【:duration="{enter:200, leave:400}"】分别指定，因为是通过数据绑定的形式获取值 -->
        <transition enter-active-class="bounceIn" leave-active-class="bounceOut" :duration="{enter:200, leave:800}">
            <h3 v-if="flag" class="animated">hello H3</h3>
        </transition>
    </div>

    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                flag: false
            },
            methods: {}
        });
    </script>
</body>

</html>